package com.controller;


import com.entity.Namespace;
import com.repository.NamespaceRepository;
import com.service.NamespaceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@RequestMapping("/deploy")
@Controller
public class DeploymentController {

    @Autowired
    NamespaceRepository namespaceRepository;

    @Autowired
    NamespaceService namespaceService;

    @GetMapping("/add")
    public String getMain(Model model) {
        List<Namespace> nslist = namespaceService.findAll();
        model.addAttribute("nslist",nslist);
        return "deployment_add";
    }
}
